package com.msb.servicemap.controller;

import com.msb.commons.response.ResponseResult;
import com.msb.commons.response.TerminalResponse;
import com.msb.servicemap.service.TerminalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * @Author: chshh
 * @version: 1.0
 */
@RestController
@RequestMapping("/terminal")
public class TerminalController {
    @Autowired
    private TerminalService terminalService;

    @PostMapping("/add")
    public ResponseResult<TerminalResponse> add(String name,String desc) {
        return terminalService.add(name,desc);
    }

    @PostMapping("/aroundsearch")
    public ResponseResult<ArrayList<TerminalResponse>> aroundsearch(String center, int radius){
        return terminalService.aroundsearch(center,radius);
    }
}
